package tech.mhuang.pacebox.springboot.protocol.data;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 通用树形结构
 *
 * @author mhuang
 * @since 1.1.2
 */
@Data
@EqualsAndHashCode(of = {"id"})
public class BaseTreeNode<T extends BaseTreeNode> {

    @ApiModelProperty(value = "当前节点id")
    private String id;

    @ApiModelProperty(value = "当前节点名称")
    private String name;

    @ApiModelProperty(value = "父节点id")
    private String parentId;

    @ApiModelProperty(value = "父节点名称")
    private String parentName;

    @ApiModelProperty(value = "子节点列表")
    private List<T> children;
}
